// 目的求三数之和
function currryAdd(fn, ...params) {
    let length = fn.length
    params = params || []
    return function(...rest) {
        rest = rest || []
        let _args = [...params, ...rest]
        return _args.length < length ? currryAdd.call(this, fn, ..._args) : fn.apply(this,_args)
    }
}
function add(a, b, c) {
    return a + b + c
}
let foo = currryAdd(add)
console.log(foo(1)(2)()(100));